package com.augurit.common.tag.button;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ComponentTagSupport;

import com.augurit.common.system.util.WebContextUtils;
import com.opensymphony.xwork2.util.ValueStack;

public class ButtonTag extends ComponentTagSupport{
	private static final long serialVersionUID = 1L;
	
	private String name;
	private String id;
	private String onclick;
	private String disabled;
	private String value;
	private String accesskey;
	private String debug;
	private String height;
	private String onblur;
	private String onkeydown;
	private String onkeypress;
	private String onkeyup;
	private String width;
	private String align;
	private String style;
	private String size;
	

	public String getHeight() {
		return height;
	}

	public String getOnblur() {
		return onblur;
	}

	public String getOnkeydown() {
		return onkeydown;
	}

	public String getOnkeypress() {
		return onkeypress;
	}

	public String getOnkeyup() {
		return onkeyup;
	}

	public String getWidth() {
		return width;
	}


	public String getAlign() {
		return align;
	}

	public String getStyle() {
		return style;
	}

	public String getSize() {
		return size;
	}

	public void setHeight(String height) {
		this.height = height;
	}

	public void setOnblur(String onblur) {
		this.onblur = onblur;
	}

	public void setOnkeydown(String onkeydown) {
		this.onkeydown = onkeydown;
	}

	public void setOnkeypress(String onkeypress) {
		this.onkeypress = onkeypress;
	}

	public void setOnkeyup(String onkeyup) {
		this.onkeyup = onkeyup;
	}

	public void setWidth(String width) {
		this.width = width;
	}


	public void setAlign(String align) {
		this.align = align;
	}

	public void setStyle(String style) {
		this.style = style;
	}

	public void setSize(String size) {
		this.size = size;
	}

	public String getDebug() {
		return debug;
	}

	public void setDebug(String debug) {
		this.debug = debug;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getDisabled() {
		return disabled;
	}

	public void setDisabled(String disabled) {
		this.disabled = disabled;
	}
	
	public String getAccesskey() {
		return accesskey;
	}

	public void setAccesskey(String accesskey) {
		this.accesskey = accesskey;
	}

	public String getName() {
		return name;
	}

	public String getId() {
		return id;
	}

	public String getOnclick() {
		return onclick;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setOnclick(String onclick) {
		this.onclick = onclick;
	}

	@Override
	public Component getBean(ValueStack arg0,
			HttpServletRequest arg1,HttpServletResponse arg2){
		Buttons btn =  new Buttons(arg0);
		btn.setSessionPrivilege((String)arg1.getSession().getAttribute(WebContextUtils.SES_LOGIN_USER_FUNC));
		//getForm
		
		return btn;	//返回buttons,处理业务逻辑
	}
	
	//获得参数
	protected void populateParams(){
		super.populateParams();
		Buttons buttons = (Buttons)component;
		buttons.setName(name);
		buttons.setId(id);
		buttons.setOnclick(onclick);
		buttons.setDisabled(disabled);
		buttons.setValue(value);
		buttons.setAccesskey(accesskey);
		buttons.setDebug(debug);
		buttons.setOnblur(onblur);
		buttons.setOnkeydown(onkeydown);
		buttons.setOnkeypress(onkeypress);
		buttons.setOnkeyup(onkeyup);
		buttons.setAlign(align);
		buttons.setSize(size);
		buttons.setStyle(style);
	}
	
}














